package com.example.educational.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.educational.entity.ReadPeople;
import com.example.educational.mapper.ReadPeopleMapper;
import com.example.educational.service.ReadPeopleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author MySoul
 * @description 针对表【edu_read_people】的数据库操作Service实现
 * @createDate 2023-05-21 08:02:54
 */
@Service
public class ReadPeopleServiceImpl extends ServiceImpl<ReadPeopleMapper, ReadPeople>
        implements ReadPeopleService {

    @Autowired
    ReadPeopleMapper readPeopleMapper;


    @Override
    public int recordReadCount(String userId, String taskId) {
        Boolean result = readPeopleMapper.updateCountByInfo(userId, taskId);
        return result ? 1 : 0;
    }
}




